package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;

import java.util.List;

class Solution802 {
    public List<Integer> eventualSafeNodes(int[][] graph) {
//        return GraphUtils.eventualSafeNodes(graph);
        return GraphUtils.eventualSafeNodes2(graph);
    }
}

public class leetcode802 {
    public static void main(String[] args) {
        Solution802 solution802 = new Solution802();
        int[][] graph = {{1, 2}, {2, 3}, {5}, {0}, {5}, {}, {}};
        int[][] graph1 = {{1, 2, 3, 4}, {1, 2}, {3, 4}, {0, 4}, {}};
        System.out.println(solution802.eventualSafeNodes(graph));
        System.out.println(solution802.eventualSafeNodes(graph1));
    }
}
